Skip to content

Conversation

saurabh-pingale
Copy link

This PR introduces enhancements to the protobuf-generated files by adding a default case handling mechanism in the generated pbjs code.

Enhancement: #1106

Changes Introduced

  • Added default case in the generated header section to handle unexpected enum values.
  • Ensures safer parsing and avoids runtime issues when new/unknown values are encountered.

Screenshots & References

  1. Proto file used for testing (test.proto)
Screenshot 2025-08-18 202730
  1. Command used to generate pbjs file
pbjs -t static-module -w commonjs -o test.js test.proto
  1. Generated file showing default case in header
Screenshot 2025-08-18 202723

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant